package com.ruoyi.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 */
public class MyConfig {

    @Component
    @ConfigurationProperties(prefix = "spring.profiles")
    public static class SpringProfiles {

        /**
         * 配置文件
         */
        private static String active;

        public static String getActive() {
            return active;
        }

        public void setActive(String active) {
            SpringProfiles.active = active;
        }
    }

    @Component
    @ConfigurationProperties(prefix = "server")
    public static class Server {

        /**
         * 端口号
         */
        private static String port;

        public static String getPort() {
            return port;
        }

        public void setPort(String port) {
            Server.port = port;
        }
    }
}
